<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePrizeRecordsTable extends Migration
{
	public function up()
	{
		Schema::create('prize_records', function(Blueprint $table) {
            $table->increments('id');
            $table->integer('prize_id')->unsigned()->index()->comment('奖品ID');
            $table->integer('user_id')->unsigned()->index()->comment('用户ID');
            $table->string('redeem_code')->nullable()->comment('领奖验证码');
            $table->boolean('redeemflag')->default(0)->comment('领奖标志');
            $table->datetime('redeem_at')->nullable()->comment('领奖时间');
            $table->integer('filiale_id')->unsigned()->nullable()->comment('商家分店ID');
            $table->boolean('sendsmsflag')->default(0)->comment('发送短信标志');
            $table->datetime('sendsms_at')->nullable()->comment('发送短信时间');
            $table->string('remark')->nullable()->comment('描述');
            $table->boolean('delflag')->default(false)->comment('删除标志');
            $table->timestamps();
        });
	}

	public function down()
	{
		Schema::drop('prize_records');
	}
}
